package org.jeecg.modules.flowable.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.flowable.entity.FlowModelParticipant;
import org.jeecg.modules.flowable.mapper.FlowModelParticipantMapper;
import org.jeecg.modules.flowable.service.FlowModelParticipantService;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class FlowModelParticipantServiceImpl extends ServiceImpl<FlowModelParticipantMapper, FlowModelParticipant> implements FlowModelParticipantService {

    @Override
    public List<FlowModelParticipant> queryByDefinitionIdAndUseScenarios(String processDefinitionId, Integer useScenarios) {
        LambdaQueryWrapper<FlowModelParticipant> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(FlowModelParticipant::getProcessDefinitionId, processDefinitionId);
        queryWrapper.eq(FlowModelParticipant::getUseScenarios, useScenarios);
        return this.list(queryWrapper);
    }
}
